//
//  LPTBaseRequest.h
//  LPTClient
//
//  Created by apple on 2018/12/3.
//  Copyright © 2018 zhaodd. All rights reserved.
//

#import "YTKBaseRequest.h"



NS_ASSUME_NONNULL_BEGIN

@class LPTBaseRequest;

typedef void(^LPTBaseRequestCompletionBlock)(__kindof LPTBaseRequest * _Nullable request, id data, NSInteger code);


@interface LPTBaseRequest : YTKBaseRequest

- (instancetype)initWithApi:(NSString*)apiName withBody:(NSDictionary *)body;

- (instancetype)initWithApi:(NSString*)apiName withBody:(NSDictionary *)body withMethod:(YTKRequestMethod)method;

- (void)startRequestCompleteSuccess:(LPTBaseRequestCompletionBlock)success
                     completeFailed:(LPTBaseRequestCompletionBlock)failed;

- (void)startRequestWithClass:(Class)className
              completeSuccess:(LPTBaseRequestCompletionBlock)success
               completeFailed:(LPTBaseRequestCompletionBlock)failed;

@property (nonatomic, copy) id responseModel;//
//@property (nonatomic, copy) NSDictionary *responseDictionary;//字典类型

@property (nonatomic, copy) id data;// 数据
@property (nonatomic, assign) NSInteger code;// 状态码
@property (nonatomic, copy) NSString *msg;// 错误消息

@property (nonatomic) BOOL needLogin; // 需要登录 

@property (nonatomic, copy, nullable) LPTBaseRequestCompletionBlock successBlock;

@property (nonatomic, copy, nullable) LPTBaseRequestCompletionBlock failureBlock;

@end

NS_ASSUME_NONNULL_END
